﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace UIMaker
{
    public partial class UIPanel : Control
    {
        UIMakerForm mainForm;
        public UIPanel(UIMakerForm mainForm)
        {
            this.mainForm = mainForm;
            InitializeComponent();
            DoubleBuffered = true;
        }

        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
            pe.Graphics.Clear(Color.Gray);
            if (mainForm.selectedScreen != null)
            {
                mainForm.selectedScreen.Render(pe.Graphics, 0, 0, this.ClientSize.Width, this.ClientSize.Height);
            }
        }
    }
}
